package com.example.androidkt.second

object StringUtil{
    fun letterCount(){}
}

fun String.letterCount() :Int{
    var count = 0
    for (char in this){
        if (char.isLetter()){
            count ++
        }
    }
    return count
}

fun getRandomLength(dataN:String) : String{
    val n = (1..10).random()
    val str = StringBuilder()
    repeat(n){
        str.append(dataN)
        str.append("\n")
    }
    return str.toString()
}
fun main() {
    val str = "abc"
    str.letterCount()

    println("getRandomLength ${getRandomLength("abc")}")
}

